<?php
//获取表前缀
$prefix = longbing_get_prefix();

//每个一个sql语句结束，都必须以英文分号结束。因为在执行sql时，需要分割单个脚本执行。
//表前缀需要自己添加{$prefix} 以下脚本被测试脚本


$sql = <<<updateSql
alter table {$prefix}lb_appoint_project add column address_switch int (3) not null default 0; 
alter table {$prefix}lb_appoint_record add column address varchar (300) not null default '';
alter table {$prefix}lb_activity_activity add column sign_number int (10) not null default 0;
alter table {$prefix}lb_activity_activity add column to_uid int (10) not null default 0;
alter table {$prefix}lb_activity_activity add column address VARCHAR (300) not null default '';
alter table {$prefix}lb_activity_activity add column text_desc VARCHAR (2000) not null default '';
alter table {$prefix}lb_activity_item_record add column title VARCHAR (50) not null default '';
alter table {$prefix}lb_activity_item_record add column activity_id int (10) not null default 0;
alter table {$prefix}lb_activity_activity add column longitude VARCHAR (30) not null default 0;
alter table {$prefix}lb_activity_activity add column latitude VARCHAR (30) not null default 0;
alter table {$prefix}longbing_card_user_info  modify column images text;
alter table {$prefix}lb_pluge_key add column version_id varchar (40) not null default '';
alter table {$prefix}lb_pluge_key add column branch_id varchar (40) not null default '';
alter table {$prefix}lb_pluge_key add column version_name varchar (40) not null default '';
alter table {$prefix}longbing_card_user add column scene int (10) not null default 0;
alter table {$prefix}longbing_card_video add column title varchar (500) not null default '';
alter table {$prefix}longbing_card_video add column top int (10) not null default 0;
alter table {$prefix}longbing_card_collection add column scene int (10) not null default 0;
alter table {$prefix}longbing_card_count add column scene int (10) not null default 0;
alter table {$prefix}longbing_card_collection add column status int (5) not null default 1;
alter table {$prefix}longbing_card_user add column `openGId` varchar (50) not null default ''
alter table {$prefix}longbing_card_user_info   add column top int (5) not null default 0;
alter table {$prefix}longbing_card_config add column mini_app_name varchar (20) not null default '';
alter table {$prefix}longbing_card_articles add column modular_id int (5) not null; 
alter table {$prefix}longbing_card_jobs add column modular_id int (5) not null; 
alter table {$prefix}longbing_card_desc add column modular_id int (5) not null; 
alter table {$prefix}longbing_card_culture add column modular_id int (5) not null; 
alter table {$prefix}longbing_card_staffs add column modular_id int (5) not null; 
alter table {$prefix}longbing_card_contact add column modular_id int (5) not null; 
alter table {$prefix}longbing_card_user add column is_qr int (3) not null default 0;
alter table {$prefix}longbing_card_user add column is_group int (3) not null default 0;
alter table {$prefix}longbing_card_user add column type int (3) not null default 0;
alter table {$prefix}longbing_card_user add column target_id int (10) not null default 0;
alter table {$prefix}longbing_card_config add column show_card int (3) not null default 0; 
alter table {$prefix}longbing_card_timeline add column user_id int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column copyright varchar (500) not null default ''; 
alter table {$prefix}longbing_card_config add column mini_template_id varchar (500) not null default ''; 
alter table {$prefix}longbing_card_collection add column status int (3) not null default 1; 
alter table {$prefix}longbing_card_user_info add column is_default int (3) not null default 1; 
alter table {$prefix}longbing_card_user add column qr_path varchar (300) not null default ''; 
alter table {$prefix}longbing_card_config add column status int (3) not null default 1; 
alter table {$prefix}longbing_card_goods add column `type` int (10) not null default 1; 
alter table {$prefix}longbing_card_goods add column `collage_count` int (10) not null default 0; 
alter table {$prefix}longbing_card_goods add column `is_collage` int (10) not null default 0; 
alter table {$prefix}longbing_card_goods add column `freight` DECIMAL (10, 2) not null default 0; 
alter table {$prefix}longbing_card_goods add column `recommend` int (3) not null default 0; 
alter table {$prefix}longbing_card_goods add column `stock` int (10) not null default 0; 
alter table {$prefix}longbing_card_goods add column `type_p` int (10) not null default 0; 
alter table {$prefix}longbing_card_shop_type add column `cover` varchar (200) not null default ''; 
alter table {$prefix}longbing_card_shop_spe_price add column `stock` int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column `allow_create` int (3) not null default 1; 
alter table {$prefix}longbing_card_shop_spe_price modify `spe_id_1` varchar (100) not null default ''; 
alter table {$prefix}longbing_card_shop_spe_price modify `spe_id_2` varchar (100) not null default ''; 
alter table {$prefix}longbing_card_user add column `is_boss` int (3) not null default 0
alter table {$prefix}longbing_card_config add column `create_text` varchar (100) not null default '创建我的智能名片'; 
alter table {$prefix}longbing_card_config add column `logo_switch` int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column `logo_text` varchar (100) not null default ''; 
alter table {$prefix}longbing_card_config add column `logo_phone` varchar (20) not null default ''; 
alter table {$prefix}longbing_card_company add column `status` int (3) not null default 1; 
alter table {$prefix}lo_ngbing_card_user_info add column `company_id` int (10) not null default 0; 
alter table {$prefix}longbing_card_timeline add column `type` int (3) not null default 0; 
alter table {$prefix}longbing_card_modular add column `show_top` int (3) not null default 0; 
alter table {$prefix}longbing_card_modular add column `show_more` int (3) not null default 0; 
alter table {$prefix}longbing_card_modular add column `show` int (3) not null default 0; 
alter table {$prefix}longbing_card_contact add column `show_map` int (3) not null default 1; 
alter table {$prefix}longbing_card_desc add column `introduction` text; 
alter table {$prefix}longbing_card_quick_reply add column `type` int (3) not null default 0; 
alter table {$prefix}longbing_card_quick_reply add column `top` int (10) not null default 0; 
alter table {$prefix}longbing_card_call add column `top` int (10) not null default 0; 
alter table {$prefix}longbing_card_company add column `short_name` varchar (100) not null default ''; 
alter table {$prefix}longbing_card_contact add column `show_map_desc` int (3) not null default 1; 
alter table {$prefix}longbing_card_user_follow add column `type` int (3) not null default 1; 
alter table {$prefix}longbing_card_config add column `notice_switch` int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column `notice_i` int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column `min_tmppid` varchar (200) not null default ''; 
alter table {$prefix}longbing_card_reply_type add column `top` int (10) not null default 0; 
alter table {$prefix}longbing_card_shop_order add column `type` int (3) not null default 0; 
alter table {$prefix}longbing_card_shop_order add column `collage_id` int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column `order_overtime` int (10) not null default 1800; 
alter table {$prefix}longbing_card_config add column `collage_overtime` int (10) not null default 172800; 
alter table {$prefix}longbing_card_shop_collage_list add column `left_number` int (10) not null default 0; 
alter table {$prefix}longbing_card_config  modify status int (3) not null default 1;
alter table {$prefix}longbing_card_modular  modify show_top int (3) not null default 1;
alter table {$prefix}longbing_card_modular  modify show_more int (3) not null default 1;
alter table {$prefix}longbing_card_modular  modify `show` int (3) not null default 1;
alter table {$prefix}longbing_card_shop_order add column `out_trade_no` varchar (50) not null default ''; 
alter table {$prefix}longbing_card_shop_order add column `courier_number` varchar (50) not null default ''; 
alter table {$prefix}longbing_card_shop_order add column `order_status` int (3) not null default 0; 
alter table {$prefix}longbing_card_shop_user_collage add column `collage_status` int (3) not null default 0; 
alter table {$prefix}longbing_card_shop_collage add column `people` int (10) not null default 2; 
alter table {$prefix}longbing_card_shop_order add column `to_uid` int (10) not null default 0; 
alter table {$prefix}longbing_card_shop_order add column `out_refund_no` varchar (50) not null default ''; 
alter table {$prefix}longbing_card_shop_order add column `express_company` varchar (50) not null default ''; 
alter table {$prefix}longbing_card_shop_order add column `express_phone` varchar (50) not null default ''; 
alter table {$prefix}longbing_card_goods add column `image_url` varchar (2000) not null default ''; 
alter table {$prefix}longbing_card_user_info   add column my_url varchar (300) not null default '';
alter table {$prefix}longbing_card_user_info   add column my_video varchar (300) not null default '';
alter table {$prefix}longbing_card_user_info   add column card_type varchar (50) not null default 'cardType1';
alter table {$prefix}longbing_card_user_info  modify `card_type` varchar (50) not null default 'cardType1';
alter table {$prefix}longbing_card_message   add column message_type varchar (50) not null default 'text';
alter table {$prefix}longbing_card_user_info   add column my_video_cover varchar (500) not null default '';
alter table {$prefix}longbing_card_quick_reply  modify `content` text;
alter table {$prefix}longbing_card_goods  modify `price` DECIMAL(10, 2) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_share_group   add column client_id int (10) not null default 0;
alter table {$prefix}longbing_card_share_group   add column target_id int (10) not null default 0;
alter table {$prefix}longbing_card_poster   add column type_id int (10) not null;
alter table {$prefix}longbing_card_timeline   add column url_type int (3) not null default 1;
alter table {$prefix}longbing_card_coupon   add column end_time int (11) not null default 0;
alter table {$prefix}longbing_card_company   add column shop_name varchar (50) not null default '';
alter table {$prefix}longbing_card_config   add column force_phone int (3) not null default 0;
alter table {$prefix}longbing_card_user_info   add column share_text varchar (2000) not null default '';
alter table {$prefix}longbing_card_config   add column staff_extract int (3) not null default 0;
alter table {$prefix}longbing_card_config   add column first_extract int (3) not null default 0;
alter table {$prefix}longbing_card_config   add column sec_extract int (3) not null default 0;
alter table {$prefix}longbing_card_collection   add column is_qr int (3) not null default 0;
alter table {$prefix}longbing_card_collection   add column openGId varchar (100) not null default '';
alter table {$prefix}longbing_card_collection   add column is_group int (3) not null default 0;
alter table {$prefix}longbing_card_collection   add column type int (3) not null default 0;
alter table {$prefix}longbing_card_collection   add column target_id int (10) not null default 0;
alter table {$prefix}longbing_card_selling_water   add column order_id int (10) not null default 0;
alter table {$prefix}longbing_card_selling_water   add column goods_id int (10) not null default 0;
alter table {$prefix}longbing_card_selling_water   add column buy_number int (10) not null default 0;
alter table {$prefix}longbing_card_coupon_record   add column desc_coupon varchar (500) not null default '';
alter table {$prefix}longbing_card_shop_order   add column record_id int (10) not null default 0;
alter table {$prefix}longbing_card_shop_order   add column record_money DECIMAL(10, 2) not null default 0;
alter table {$prefix}longbing_card_user_info   add column t_number int (10) not null default 0;
alter table {$prefix}longbing_card_user_info   add column view_number int (10) not null default 0;
alter table {$prefix}longbing_card_user_info   add column phone400 varchar (20) not null default '';
alter table {$prefix}longbing_card_config   add column `code` varchar (20) not null default '';
alter table {$prefix}longbing_card_config   add column `corpid` varchar (200) not null default '';
alter table {$prefix}longbing_card_config   add column `corpsecret` varchar (200) not null default '';
alter table {$prefix}longbing_card_user_info   add column `ww_account` varchar (200) not null default '';
alter table {$prefix}longbing_card_config   add column `agentid` varchar (200) not null default '';
alter table {$prefix}longbing_card_form   add column `modular_id` int (10) not null default 0;
alter table {$prefix}longbing_card_modular   add column `remark` varchar (100) not null default '';
alter table {$prefix}longbing_card_goods   add column `unit` varchar (100) not null default '个';
alter table {$prefix}longbing_card_shop_order   add column `transaction_id` varchar (100) not null default '';
alter table {$prefix}longbing_card_poster   add column `cover` varchar (300) not null default '';
alter table {$prefix}longbing_card_config   add column `wx_appid` varchar (100) not null default '';
alter table {$prefix}longbing_card_config   add column `wx_tplid` varchar (100) not null default '';
alter table {$prefix}longbing_card_job add column top int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column redis_pas varchar (100) not null default ''; 
alter table {$prefix}longbing_card_selling_profit modify `waiting` DECIMAL(10, 2) not null default 0; 
alter table {$prefix}longbing_card_config add column cash_mini DECIMAL (10, 2) not null default 0; 
alter table {$prefix}longbing_card_config add column admin_account varchar (100) not null default ''; 
alter table {$prefix}longbing_card_selling_profit add column profit DECIMAL (10, 2) not null default 0; 
alter table {$prefix}longbing_card_selling_cash_water add column user_id int (10) not null; 
alter table {$prefix}longbing_card_collection add column handover_id int (10) not null default 0; 
alter table {$prefix}longbing_card_collection add column handover_name varchar (50) not null default ''; 
alter table {$prefix}longbing_card_selling_cash_water add column cash_no varchar (50) not null default ''; 
alter table {$prefix}longbing_card_user add column create_money DECIMAL (10, 2) not null default 0; 
alter table {$prefix}longbing_card_config add column plug_form int (4) not null default 0; 
alter table {$prefix}longbing_card_user_info add column bg varchar (200) not null default ''; 
alter table {$prefix}longbing_card_user_info add column bg_switch int (4) not null default 0; 
alter table {$prefix}longbing_card_tags add column top int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column btn_consult varchar (20) not null default '咨询'; 
alter table {$prefix}longbing_card_config add column btn_sale varchar (20) not null default '销售管家'; 
alter table {$prefix}longbing_card_config add column btn_code_err varchar (200) not null default '免审口令填写错误'; 
alter table {$prefix}longbing_card_config add column btn_code_miss varchar (200) not null default '免审口令未填写'; 
alter table {$prefix}longbing_card_config add column preview_switch int (4) not null default 0; 
alter table {$prefix}longbing_card_company add column top int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column btn_talk varchar (20) not null default '面议'; 
alter table {$prefix}longbing_card_goods add column is_self int (4) not null default 0; 
alter table {$prefix}longbing_card_goods add column `extract` int (10) not null default 0; 
alter table {$prefix}longbing_card_config add column receiving int (10) not null default 5; 
alter table {$prefix}longbing_card_config add column ios_pay int (4) not null default 1; 
alter table {$prefix}longbing_card_config add column android_pay int (4) not null default 1; 
alter table {$prefix}longbing_card_config add column self_text varchar (200) not null default '自提商品'; 
alter table {$prefix}longbing_card_config add column default_video varchar (200) not null default ''; 
alter table {$prefix}longbing_card_config add column default_voice varchar (200) not null default ''; 
alter table {$prefix}longbing_card_config add column card_type int (3) not null default 1; 
alter table {$prefix}longbing_card_config add column order_pwd varchar (40) not null default ''; 
alter table {$prefix}longbing_card_timeline modify `cover` varchar(5000) not null default ''; 
alter table {$prefix}longbing_card_config add column exchange_switch int (3) not null default 1; 
alter table {$prefix}longbing_card_config add column motto_switch int (3) not null default 1; 
alter table {$prefix}longbing_card_shop_collage add column `limit` int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column default_voice_switch int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column myshop_switch int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column aliyun_sms_access_key_id varchar (50) not null default ''; 
alter table {$prefix}longbing_card_config add column aliyun_sms_access_key_secret varchar (50) not null default ''; 
alter table {$prefix}longbing_card_articles modify `content` longtext; 
alter table {$prefix}longbing_card_shop_order add column write_off_id int (10) not null default 0; 
alter table {$prefix}longbing_card_desc modify `content` longtext; 
alter table {$prefix}longbing_card_desc modify `introduction` longtext; 
alter table {$prefix}longbing_card_goods modify `content` longtext; 
alter table {$prefix}longbing_card_user add column `ip` varchar (50) not null default ''; 
alter table {$prefix}longbing_card_goods add column `s_title` varchar (500) not null default '' COMMENT '副标题'; 
alter table {$prefix}longbing_card_config add column `default_shop_name` varchar (500) not null default '' COMMENT '默认商城名称'; 
alter table {$prefix}longbing_card_config add column `default_shop_pic` varchar (500) not null default '' COMMENT '默认商城背景图'; 
alter table {$prefix}longbing_card_config add column `default_video_cover` varchar (500) not null default '' COMMENT '视频默认封面图'; 
alter table {$prefix}longbing_card_tabbar add column menu_appoint_name VARCHAR (20) not null default '预约';
alter table {$prefix}longbing_card_tabbar add column menu_appoint_is_hide int (10) not null default 1;
alter table {$prefix}longbing_card_tabbar add column menu_appoint_url VARCHAR (500) not null default '/longbing_card/reserve/pages/index/index';
alter table {$prefix}longbing_card_tabbar add column menu_appoint_url_out VARCHAR (500) not null default '';
alter table {$prefix}longbing_card_tabbar add column menu_appoint_url_jump_way INT (3) not null default 0;
alter table {$prefix}longbing_card_tabbar add column menu_activity_name VARCHAR (20) not null default '活动报名';
alter table {$prefix}longbing_card_tabbar add column menu_activity_is_show int (10) not null default 0;
alter table {$prefix}longbing_card_tabbar add column menu_activity_url VARCHAR (500) not null default '/longbing_card/enroll/pages/index';
alter table {$prefix}longbing_card_tabbar add column menu_activity_url_out VARCHAR (500) not null default '';
alter table {$prefix}longbing_card_tabbar add column menu_activity_url_jump_way INT (3) not null default 0;
alter table {$prefix}longbing_card_config add column `appoint_pic` varchar (500) not null default '' COMMENT '预约背景图'; 
alter table {$prefix}longbing_card_config add column `appoint_name` varchar (500) not null default '' COMMENT '预约标题'; 
alter table {$prefix}longbing_card_config add column `click_copy_way` int (3) not null default 1 COMMENT '点击版权效果 1 => 拨打电话 2 => 跳转网页 3 => 跳转小程序 4 => 查看大图'; 
alter table {$prefix}longbing_card_config add column `click_copy_show_img` varchar (500) not null default '' COMMENT '当点击版权效果是查看大图时, 弹出此图片'; 
alter table {$prefix}longbing_card_config add column `click_copy_content` varchar (500) not null default '' COMMENT '点击版权效果 手机号 网址 appid'; 
alter table {$prefix}lb_marketing_record add column `number` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}lb_marketing_record add column `length` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}lb_marketing_article_v2 add column `poster` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_config add column `question_switch` INT (3) not null default 0 COMMENT '是否开启问卷功能'; 
alter table {$prefix}longbing_card_config add column `question_text` VARCHAR (200) not null default '问卷' COMMENT '问卷文字'; 
alter table {$prefix}longbing_card_user add column `import` INT (3) not null default 0 COMMENT '是否是后台导入'; 
alter table {$prefix}longbing_card_collection add column `distribution` INT (3) not null default 0 COMMENT '是否是后台分配的'; 
alter table {$prefix}longbing_card_user add column `pay_qr` varchar (300) not null default ''; 
alter table {$prefix}longbing_card_config add column `shop_version` INT (3) not null default 0; 
alter table {$prefix}longbing_card_config add column `shop_carousel_more` varchar (300) not null default ''; 
alter table {$prefix}longbing_card_timeline modify `content` longtext; 
alter table {$prefix}longbing_card_timeline add column `article_id` int (10) not null default 0; 
alter table {$prefix}longbing_card_user add column `unionid` varchar (40) not null default ''; 
alter table {$prefix}longbing_card_user add column `is_article` int (3) not null default 0; 
alter table {$prefix}longbing_card_config add column `exchange_btn` varchar (40) not null default '交换手机号'; 
alter table {$prefix}longbing_card_goods add column `switch` int (3) not null DEFAULT 1; 
alter table {$prefix}lb_marketing_record add column `number` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}lb_marketing_article_v2 add column `share_self` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}lb_marketing_article_v2 add column `share_other` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_config add column `my_shop_limit` int(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user_info add column `autograph` int(11) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user_info add column `signature` int(11) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_config add column `autograph` int(11) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_config add column `signature` int(11) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_goods add column `staff_switch` int(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_goods add column `staff_extract` int(11) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_shop_order add column `refund_status` int(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user_info add column `vr_tittle` VARCHAR(50) NOT NULL DEFAULT 'VR全景';
alter table {$prefix}longbing_card_user_info add column `vr_cover` VARCHAR(300) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_user_info add column `vr_path` VARCHAR(300) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_user_info add column `vr_switch` INT(3) NOT NULL DEFAULT 1;
alter table {$prefix}longbing_card_config add column `vr_tittle` VARCHAR(50) NOT NULL DEFAULT 'VR全景';
alter table {$prefix}longbing_card_config add column `vr_cover` VARCHAR(300) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_config add column `vr_path` VARCHAR(300) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_config add column `vr_switch` INT(3) NOT NULL DEFAULT 1;
alter table {$prefix}longbing_card_config add column `qr_avatar_switch` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_modular add column `list_limit` INT(3) NOT NULL DEFAULT 3;
alter table {$prefix}longbing_card_shop_order add column `company_id` INT(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_shop_order add column `zt_name` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '自提订单的客户姓名';
alter table {$prefix}longbing_card_shop_order add column `zt_phone` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '自提订单的客户联系方式';
alter table {$prefix}longbing_card_config add column `auto_switch` INT(3) NOT NULL DEFAULT 0 COMMENT '自动分配员工开关';
alter table {$prefix}longbing_card_config add column `auto_switch_way` INT(3) NOT NULL DEFAULT 1 COMMENT '自动分配推荐员工方式';
alter table {$prefix}longbing_card_user_info add column `auto_count` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_collection add column `is_auto` INT(3) NOT NULL DEFAULT 0;
DROP INDEX uid ON {$prefix}longbing_card_collection ;
alter table {$prefix}longbing_card_user DEFAULT CHARACTER SET utf8mb4;
alter table {$prefix}longbing_card_user CHANGE `nickName` `nickName` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '';
DROP INDEX openid ON {$prefix}longbing_card_user;
alter table {$prefix}longbing_card_user ADD UNIQUE openid_uniacid(openid, uniacid);	
alter table {$prefix}longbing_card_coupon add column `limit_type` int(11) NOT NULL DEFAULT '0' COMMENT '限制类型0：不限制；1：分类，2：商品';
alter table {$prefix}longbing_card_coupon add column `limit_goods` text NOT NULL COMMENT '限制商品';
alter table {$prefix}longbing_card_coupon add column `limit_cate` varchar(225) NOT NULL DEFAULT '0' COMMENT '限制分类';
alter table {$prefix}longbing_card_config add column `coupon_pass` int(11) NOT NULL DEFAULT '0' COMMENT '线下福包核销密码';
alter table {$prefix}longbing_card_coupon_record add column `limit_type` int(11) NOT NULL DEFAULT '0' COMMENT '限制类型';
alter table {$prefix}longbing_card_coupon_record add column `limit_cate` varchar(255) NOT NULL DEFAULT '0' COMMENT '限用分类';
alter table {$prefix}longbing_card_coupon_record add column `limit_goods` text NOT NULL COMMENT '限用商品';
alter table {$prefix}longbing_card_tabbar add column `menu_house_name` varchar(20) NOT NULL DEFAULT '房产';
alter table {$prefix}longbing_card_tabbar add column `menu_house_is_show` int(2) NOT NULL DEFAULT '1' COMMENT '是否展示';
alter table {$prefix}longbing_card_tabbar add column `menu_house_url` varchar(500) NOT NULL DEFAULT '/longbing_card/house/pages/index/index';
alter table {$prefix}longbing_card_tabbar add column `menu_house_url_out` varchar(500) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_tabbar add column `menu_house_url_jump_way` int(2) NOT NULL DEFAULT '0';
alter table {$prefix}longbing_card_house_category add column `img` varchar(500) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_house modify `longitude` varchar(30) not null default 0; 
alter table {$prefix}longbing_card_house modify `latitude` varchar(30) not null default 0; 
alter table {$prefix}longbing_card_count add column `unread` int(3) NOT NULL DEFAULT 1;
CREATE INDEX count_unread ON {$prefix}longbing_card_count (unread);
alter table {$prefix}longbing_card_collection modify `create_time` INT (11) not null default 0; 
alter table {$prefix}longbing_card_collection modify `update_time` INT (11) not null default 0; 
alter table {$prefix}longbing_card_user add column `lock_id` INT(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user_info add column `share_number` INT(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_collection add column `intention` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user add column `city` VARCHAR(30) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_user add column `province` VARCHAR(30) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_user add column `country` VARCHAR(30) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_user add column `gender` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user add column `language` VARCHAR(30) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_goods add column `company_id` varchar(256) NOT NULL DEFAULT '0' COMMENT '所属公司id';
alter table {$prefix}longbing_card_collection add column `rate` INT(4) NOT NULL DEFAULT 5;
alter table {$prefix}longbing_card_company add column `auth_code` VARCHAR(50) NOT NULL DEFAULT '';
CREATE INDEX count_user_id ON {$prefix}longbing_card_count (user_id);
CREATE INDEX count_to_uid ON {$prefix}longbing_card_count (to_uid);
CREATE INDEX count_type ON {$prefix}longbing_card_count (`type`);
CREATE INDEX count_sign ON {$prefix}longbing_card_count (sign);
alter table {$prefix}longbing_card_config add column `job_switch` INT(3) NOT NULL DEFAULT 1;
alter table {$prefix}longbing_card_count add column `duration` INT(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_client_info add column `wechat` VARCHAR(50) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_client_info add column `area` VARCHAR(50) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_collection add column `follow_time` INT(11) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_config add column `appid` VARCHAR(40) NOT NULL DEFAULT '';
alter table {$prefix}longbing_card_config add column `app_secret` VARCHAR(40) NOT NULL DEFAULT '';
alter table {$prefix}lb_activity_activity add column `sign_start_time` INT(11) NOT NULL DEFAULT 0;
alter table {$prefix}lb_activity_activity add column `sign_end_time` INT(11) NOT NULL DEFAULT 0;
alter table {$prefix}lb_activity_item add column `is_phone` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}lb_activity_activity_item add column `is_phone` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}lb_activity_activity_item add column `is_phone` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}lb_activity_item_record add column `is_phone` INT(3) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user_info modify `desc` varchar(5000) not null default ''; 
alter table {$prefix}lb_appoint_project add column `start_date` INT(11) NOT NULL DEFAULT 0;
alter table {$prefix}lb_appoint_project add column `end_date` INT(11) NOT NULL DEFAULT 0;
alter table {$prefix}lb_appoint_project add column `max_day` INT(11) NOT NULL DEFAULT 1;
alter table {$prefix}longbing_card_config add column `chat_switch` INT(3) NOT NULL DEFAULT 1;
alter table {$prefix}longbing_card_config add column `auth_switch` INT(3) NOT NULL DEFAULT 1;
alter table {$prefix}longbing_card_user add column `last_staff_id` INT(10) NOT NULL DEFAULT 0;
alter table {$prefix}longbing_card_user_label change `lable_id` `label_id` INT(10) not null default 0; 
alter table {$prefix}longbing_card_timeline add COLUMN `thumb` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '点赞数量' ;
alter table {$prefix}longbing_card_timeline add COLUMN `release_time` varchar(20) NULL DEFAULT '' COMMENT '发布时间' ;
alter table {$prefix}longbing_card_desc add COLUMN `top` int(11) NULL DEFAULT 0 COMMENT '排序值' ;
alter table {$prefix}longbing_card_contact add COLUMN `top` int(11) NULL DEFAULT 0 COMMENT '排序值' ;
alter table {$prefix}ims_longbing_card_form add COLUMN `top` int(11) NULL DEFAULT 0 COMMENT '排序值' ;
alter table {$prefix}longbing_card_company add COLUMN `top_id`  int NULL DEFAULT 0 COMMENT '公司最上级id' AFTER `auth_code`; 
alter table {$prefix}longbing_card_company add COLUMN `pid`  int NULL DEFAULT 0 COMMENT '公司最上级id' AFTER `auth_code`; 
alter table {$prefix}longbing_card_statistics add COLUMN `table`  varchar(50) NULL COMMENT '记录名称' ; 
alter table {$prefix}longbing_card_modular  DROP INDEX `identification`;
alter table {$prefix}longbing_card_user add `deleted` TINYINT(3) NOT NULL DEFAULT '0' ;
alter table {$prefix}longbing_oos_config add COLUMN `is_sync`  tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否同步' ;
alter table {$prefix}longbing_card_config add COLUMN `is_sync`  tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否同步' ;
alter table {$prefix}longbing_card_message add COLUMN `deleted`  tinyint(3) NOT NULL DEFAULT 0 ;
alter table {$prefix}longbing_card_chat add COLUMN `deleted`  tinyint(3) NOT NULL DEFAULT 0 ;
alter table {$prefix}core_attachment ADD COLUMN `longbing_attachment_path`  char(255) NOT NULL DEFAULT '' COMMENT 'path'; 
alter table {$prefix}core_attachment ADD COLUMN `longbing_driver`  char(10) NOT NULL DEFAULT '' COMMENT 'loacl'; 
alter table {$prefix}core_attachment add COLUMN `longbing_from`  varchar(255) NOT NULL DEFAULT '' COMMENT 'web'; 
alter table {$prefix}longbing_card_collection add `update_rate_time` INT(11) NOT NULL DEFAULT '0' COMMENT '更新rate时间'; 
alter table {$prefix}core_attachment  CHANGE `module_upload_dir` `module_upload_dir` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
alter table {$prefix}core_attachment  CHANGE `displayorder` `displayorder` INT(10) NULL; 
alter table {$prefix}core_attachment  CHANGE `group_id` `group_id` INT(11) NULL DEFAULT NULL;
alter table {$prefix}longbing_card_user_info ADD INDEX `fans_id` (`fans_id`) USING BTREE ;
alter table {$prefix}longbing_card_user_mark ADD INDEX `user_id` (`user_id`) USING BTREE ;
alter table {$prefix}longbing_card_user_phone ADD INDEX `user_id` (`user_id`) USING BTREE ;
alter table {$prefix}longbing_card_selling_profit ADD INDEX `user_id` (`user_id`) USING BTREE ;
alter table {$prefix}longbing_card_user DROP INDEX `pid`, ADD INDEX `pid` (`pid`) USING BTREE  ;
alter table {$prefix}longbing_card_message DROP INDEX `chat_id`, ADD INDEX `chat_id` (`chat_id`, `user_id`, `target_id`, `create_time`) USING BTREE ;
alter table {$prefix}lb_activity_user_record add column  is_sign_in  tinyint(1) NOT NULL default 0 comment '1 -已签到， 0-待签到'; 
alter table {$prefix}lb_activity_user_record add COLUMN  `staff_id` int(11) NOT NULL default 0 comment '员工id' ; 
alter table {$prefix}longbing_card_shop_order_refund add column `refund_price` double(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额';
alter table {$prefix}longbing_card_shop_order_refund add column `refund_price` double(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额';
alter table {$prefix}longbing_card_goods add column `video` varchar(255) NOT NULL DEFAULT '0' COMMENT '视频';
alter table {$prefix}longbing_card_goods add column `video_cover` varchar(255) NOT NULL DEFAULT '0' COMMENT '视频封面图';
alter table {$prefix}longbing_card_shop_spe_price add column `original_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原价';
alter table {$prefix}longbing_card_house_appointment add column `text` text NOT NULL COMMENT '备注';
alter table {$prefix}longbing_card_house_collect add column `text` text NOT NULL COMMENT '备注';
alter table {$prefix}longbing_cardauth2_config add column remark varchar (200) not null default '';
alter table {$prefix}longbing_cardauth2_config add column end_time int (10) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column mini_name varchar (100) not null default '';
alter table {$prefix}longbing_cardauth2_config add column copyright_id int (10) not null default 0;
alter table {$prefix}longbing_cardauth2_default add column send_switch int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column send_switch int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column boos int (10) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column appoint int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column payqr int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column shop_switch int (3) not null default 1;
alter table {$prefix}longbing_cardauth2_config add column timeline_switch int (3) not null default 1;
alter table {$prefix}longbing_cardauth2_config add column website_switch int (3) not null default 1;
alter table {$prefix}longbing_cardauth2_config add column article int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column activity_switch int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column pay_shop int (3) not null default 1;
alter table {$prefix}longbing_cardauth2_config add column house_switch int (3) not null default 0;
alter table {$prefix}longbing_cardauth2_config add column tool_switch int (3) not null default 1;
alter table {$prefix}longbing_card_shop_address modify column `sex` varchar(30) NOT NULL DEFAULT '0';
alter table {$prefix}longbing_card_shop_address modify column `province` varchar(30) NOT NULL DEFAULT '0';
alter table {$prefix}longbing_card_shop_address modify column `city` varchar(30) NOT NULL DEFAULT '0';
alter table {$prefix}longbing_card_shop_address modify column `area` varchar(30) NOT NULL DEFAULT '0';
alter table {$prefix}longbing_card_form add column  `top` int(11) NOT NULL DEFAULT '0';
alter table {$prefix}longbing_card_timeline add column  `company_id` int(11) NOT NULL DEFAULT '0' COMMENT '公司id';
alter table {$prefix}longbing_card_timeline add column  `is_company` int(11) NOT NULL DEFAULT '0' COMMENT '是否是平台发布';
ALTER TABLE `{$prefix}longbing_card_count` ADD INDEX `count_radar` (`to_uid`, `type`, `sign`, `uniacid`) ;
ALTER TABLE `{$prefix}longbing_card_count` ADD INDEX `count_user_unread` (`to_uid`, `unread`) USING BTREE ;
ALTER TABLE `{$prefix}longbing_card_user` ADD COLUMN `baidu_openid`  varchar(50) NOT NULL DEFAULT '' COMMENT '百度小程序';

alter table {$prefix}longbing_cardauth2_config add column `passenger_switch` int(3) NOT NULL DEFAULT '0';

alter table {$prefix}longbing_cardauth2_config add column `baidu_switch` int(3) NOT NULL DEFAULT '0';

alter table {$prefix}longbing_cardauth2_config add column `closure_switch` int(3) NOT NULL DEFAULT '0';

alter table {$prefix}longbing_cardauth2_config add column `redbag_switch` int(3) NOT NULL DEFAULT '0';

alter table {$prefix}longbing_cardauth2_config add column `reduction_switch` int(3) NOT NULL DEFAULT '0';

alter table {$prefix}longbing_cardauth2_config add column `livevideo_switch` int(3) NOT NULL DEFAULT '0';

alter table {$prefix}longbing_cardauth2_config add column `shortvideo_switch` int(3) NOT NULL DEFAULT '0' COMMENT '短视频开关';

alter table {$prefix}longbing_cardauth2_config add column `member_switch` int(3) NOT NULL DEFAULT '0' COMMENT '会员开关';

alter table {$prefix}longbing_cardauth2_config add column `restaurant_switch` int(3) NOT NULL DEFAULT '0' COMMENT '餐饮';

alter table {$prefix}longbing_cardauth2_config add column `agent_id` int(11) NOT NULL DEFAULT '0' COMMENT '代理商';

alter table {$prefix}longbing_cardauth2_config add column `upload_setting` int(11) DEFAULT '0' COMMENT '上传配置';

alter table {$prefix}longbing_cardauth2_config add column `overlord_switch` int(3) NOT NULL DEFAULT '0' COMMENT '霸王餐';

alter table {$prefix}longbing_oos_config add column `name` varchar(64) NOT NULL DEFAULT '' COMMENT '储蓄名字';

alter table {$prefix}longbing_cardauth2_config add column `payclass_switch` int(3) NOT NULL DEFAULT '0' COMMENT '付费课程';

alter table {$prefix}longbing_cardauth2_config add column `bargain_switch` int(3) NOT NULL DEFAULT '0' COMMENT '砍价';

alter table {$prefix}longbing_cardauth2_config add column `question_switch` int(3) NOT NULL DEFAULT '0' COMMENT '砍价';

alter table {$prefix}longbing_cardauth2_config add column `appclass_switch` int(3) NOT NULL DEFAULT '0' COMMENT '约课';

alter table {$prefix}longbing_cardauth2_config add column `helppay_switch` int(3) NOT NULL DEFAULT '0' COMMENT '代付';

alter table {$prefix}longbing_cardauth2_config add column `material_switch` int(3) NOT NULL DEFAULT '0' COMMENT '智能文件夹';

alter table {$prefix}longbing_cardauth2_config add column `brochure_switch` int(3) NOT NULL DEFAULT '0' COMMENT '智能宣传册';

alter table {$prefix}longbing_cardauth2_config add column `car_switch` int(3) NOT NULL DEFAULT '0' COMMENT '汽车版';

alter table {$prefix}longbing_cardauth2_config add column `douyin_switch` int(3) NOT NULL DEFAULT '0' COMMENT '抖音';

alter table {$prefix}longbing_cardauth2_config add column `banquet_switch` int(3) NOT NULL DEFAULT '0' COMMENT '宴会厅';

alter table {$prefix}longbing_cardauth2_config add column `integral_switch` int(3) NOT NULL DEFAULT '0' COMMENT '积分商城';


CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_agent_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT '' COMMENT '昵称',
  `mobile` varchar(32) DEFAULT '' COMMENT '电话',
  `level` int(11) DEFAULT '0' COMMENT '代理等级',
  `province` varchar(64) DEFAULT '' COMMENT '省',
  `city` varchar(64) DEFAULT '' COMMENT '市',
  `over_time` int(11) DEFAULT '0' COMMENT '到期时间',
  `create_time` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT '0',
  `status` int(11) DEFAULT '1' COMMENT '状态 备用',
  `province_code` varchar(64) DEFAULT '0',
  `city_code` varchar(64) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE IF NOT EXISTS `{$prefix}longbing_card_agent_level` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(11) DEFAULT NULL,
  `title` varchar(255) DEFAULT '' COMMENT '代理等级名字',
  `top` int(11) DEFAULT '0' COMMENT '排序值',
  `content` varchar(1000) DEFAULT '' COMMENT '备注',
  `status` int(11) DEFAULT '1' COMMENT '状态',
  `create_time` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='代理商等级表';


alter table {$prefix}longbing_admin add column `level` int(11) NOT NULL DEFAULT '0' COMMENT '用户等级';

alter table {$prefix}longbing_card_config add column `share_btn` varchar(64) DEFAULT '发名片';

alter table {$prefix}longbing_card_user add column `birthday` varchar(64) DEFAULT '';

alter table {$prefix}longbing_card_count add column `total_page` int(11) DEFAULT '0' COMMENT '总页数';

alter table {$prefix}longbing_card_count add column `read_page` int(11) DEFAULT '0' COMMENT '浏览页数';

alter table {$prefix}longbing_card_count add column `start_time` bigint(11) DEFAULT '0' COMMENT '开始时间';

alter table {$prefix}longbing_card_config add column `dy_appid` varchar(64) DEFAULT '' COMMENT '抖音appid';

alter table {$prefix}longbing_card_config add column `dy_secret` varchar(64) DEFAULT '' COMMENT '抖音密钥';

alter table {$prefix}longbing_card_company add column `background_map` varchar(255) DEFAULT '' COMMENT '场地预约背景图';

alter table {$prefix}longbing_card_company add column `business_hours` varchar(255) DEFAULT '' COMMENT '营业时间';

alter table {$prefix}longbing_card_company add column `banquet_mobile` varchar(32) DEFAULT '' COMMENT '场地预约电话';

alter table {$prefix}longbing_card_company add column `service_tag` varchar(1024) DEFAULT '' COMMENT '服务标签';

alter table {$prefix}longbing_card_company add column `staff_id` int(11) DEFAULT '0';




updateSql;

return $sql;